<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\Admin;
use Illuminate\Support\Facades\Hash;

class AdminSeeder extends Seeder
{
    /**
     * 运行数据库种子
     *
     * @return void
     */
    public function run()
    {
        // 创建默认管理员账号
        Admin::create([
            'username' => 'admin',
            'name' => '系统管理员',
            'password' => Hash::make('admin123'),
            'is_active' => true,
        ]);
        
        $this->command->info('默认管理员账号已创建：');
        $this->command->info('用户名: admin');
        $this->command->info('密码: admin123');
        $this->command->warn('请在首次登录后修改默认密码！');
    }
} 